#include <iostream>
using namespace std;
/*
3、Create a class that holds an array of ints. 
Set the size of the array using static const int inside the class.
Add a const int variable, and initialize it in the constructor initializer list; 
make the constructor inline. 
Add a static int member variable and initialize it to a specific value. 
Add a static member function that prints the static data member. 
Add an inline member function called print( ) to print out all the values in the array and to call the static member function. 
Exercise this class in main( ).
*/
class C1{
public:
    static const int len = 10;
    int arr[len];

    const int num;
    
    inline C1(int num):num(num) {}
    
    static int data;
    static void func(){
        cout << "the static int member variable = " << data << endl;
    }
    
    inline void print(){
        for(int i = 0; i < len; i++){
            cout << arr[i] << " ";
        }
        cout << endl;
        
        func();
    }

};

int C1::data = 99;

int main()
{
    C1 c1(0);
    
    //为数组赋值
    for(int i = 0; i < c1.len; i++){
        c1.arr[i] = i + 100;
    }
    
    c1.print();

    return 0;
}